package 代码记录.校招笔试真题.笔试真题_2023.北京360;

import java.util.Scanner;

/**
 * @author zx
 * @create 2023-03-18 15:22
 * 100%
 */
public class Test1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for(int i = 0;i < n;i++){
            arr[i] = sc.nextInt();
        }
        int[] res = new int[n];
        boolean[] flag = new boolean[n];
        int count = 0;
        for(int i = 0;i < n;i++){
            flag[(arr[i] - 1)] = true;
            for(int j = 0;j < n;j++){
                if(flag[j] == false){
                    break;
                }
                if(flag[j] == true && res[count] == 0 && count <= j){
                    res[count] = i + 1;
                    count++;
                }
            }
        }
        for(int i = 0;i < n - 1;i++){
            System.out.print(res[i] + " ");
        }
        System.out.print(res[n - 1]);
    }
}
